﻿package com.wandian.view.components.ui
{
	import com.wandian.data.GameData;
	import com.wandian.model.*;
	import com.wandian.model.vo.*;
	import com.wandian.util.CLZLoadIcon;
	import com.wandian.util.LoadIconUtil;
	import com.wandian.util.loader.ImageLoader;

	import flash.display.Bitmap;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	/**   
	* @author long
	* @QQ 108232706
	* @version 1.0   
	*/   
	public class Gift extends Sprite
	{
		private var _image:ImageLoader;
		private var _global:GameData;
		public var id:int;
		private var _mcGift:Sprite;

		public function Gift(param1:Sprite=null):void
		{
			this._global=GameData.getInstance();
			this._mcGift=param1;
			if (this._mcGift == null)
			{
				this._mcGift=new Sprite();
				this.addChild(this._mcGift);
			}
			return;
		} 

		public function showGift(param1:int, param2:int):void
		{
			this.removeGift();
			if (param1 == 0)
			{
			}
			if (param1 == 0)
			{
				return;
			}
			var _loc_3:*=GameData.getPropById(param1, param2);
			CLZLoadIcon.addIcon(this._mcGift, _loc_3.url, 50, 50, 0, 0, "", false, false);
			GameData.playMcAllChild(this._mcGift);
			return;
		} 

		public function removeGift():void
		{
			var _loc_1:*=undefined;
			while (this._mcGift.numChildren > 0)
			{

				_loc_1=this._mcGift.removeChildAt(0);
				GameData.stopMcAllChild(_loc_1);
				_loc_1=null;
			}
			return;
		} 

		public function changeGift(param1:Bitmap):void
		{
			this.removeGift();
			this._mcGift.addChild(param1);
			return;
		} 

		public function get mcGift():Sprite
		{
			return this._mcGift;
		} 

	}
}
